<?
if(($config['table_non_phone'] || !$isphone) && $list_mode != 'm') { 
?>
<? if($isphone) { ?><div style="width:100%; height:auto; overflow:scroll"><? } 
$tableWidth = $isphone?($totalwidth*0.7):$totalwidth;
$list_titles = $config['titles'];
?>
<table cellpadding="0" cellspacing="0" border="0" class="tb" style="width:<?=$tableWidth?>px;<?=$config_hide_frame_left?"margin:0px auto;":""?>" id="list_table">
<? foreach($titles as $item) { 
	?>
<col width="<?=$isphone?round($item[0]*0.7):$item[0]?>" />
<? } ?>

<?
if($list_titles) {
	foreach($list_titles as $n1 => $item1) {
		echo '<tr>';
		foreach($item1 as $n2 => $item2) {
			$rowspan = $item2['rowspan'];
			$colspan = $item2['colspan'];
			$style = $item2['style'];
			echo '<th style="padding:3px 0px;background:#F6F6F6;';
			if($n1 != 0) {
				echo 'border-top:1px solid #E5E5E5;';
			}
			if($n2 != count($item1) - 1) {
				echo 'border-right:1px solid #E5E5E5;';
			}
			if($style) {
				echo $style.';';
			}
			echo '" ';
			if($colspan) echo ' colspan="'.$colspan.'" ';
			if($rowspan) echo ' rowspan="'.$rowspan.'" ';
			echo '>'.$item2['title'].'</th>';

		}
		echo '</tr>';
	}
	
} else {
	echo '<tr>';
	foreach($titles as $n => $item) {
		echo '<th style="padding:5px 0px;background:#F6F6F6;'.(($n != count($titles) - 1)?"border-right:1px solid white;":"").'">'.$item[1].'</th>';
	}
	echo '</tr>';
}

/*<input class="button" type="button" value="入单" style="cursor:pointer" onclick="rd(<?=$item['id']?>, this)" />*/
$listTrIdArr = $GLOBALS['listTrIdArr'];
$listTrStyleArr = $GLOBALS['listTrStyleArr'];

foreach($showListArr as $key => $item) {
	$trid = '';
	if($listTrIdArr[$key]) {
		$trid = ' id="trid_'.$listTrIdArr[$key].'"';
	}
	$trstyle = '';
	if($listTrStyleArr[$key]) {
		$trstyle = ' style="'.$listTrStyleArr[$key].'"';
		
	}
	?>
<tr onmouseover="this.style.backgroundColor='#f3f3f3'" onmouseout="this.style.backgroundColor=''"<?=$trid?><?=$trstyle?>>
<? foreach($item as $v) { 
		if(!is_array($v)) $v = array('html' => $v);
		$align = 'center';
		if($v['align']) $align = $v['align'];
		$style = $v['style'];
		?>
		<td align="<?=$align?>" height="30"<? if($style) echo ' style="'.$style.'"';?>><?
		
		echo $v['html'];
		?></td>
		
<? } ?>
	
	
	
</tr>
<? 
} 
$GLOBALS['listTrIdArr'] = false;
$GLOBALS['listTrStyleArr'] = false;
?>

</table>
<? if($isphone) { ?></div><? } ?>
<? } else {
foreach($showListArr as $key => $item) { 
	echo '<div style="border:1px solid #dddddd; height:auto; margin-bottom:10px; padding:4px; border-radius:5px;background:#f9f9f9;box-shadow: 2px 2px 10px #bbbbbb;">';
	foreach($title_widths as $key2 => $item2) { ?>
	<table cellpadding="0" cellspacing="1" border="0" class="tb_m" width="100%">
	<tr>
		<? foreach($item2 as $item3) { ?>
			<th align="left"><?=$titles[$item3][1]?></th>
		<? } ?>
	</tr>
	<tr>
		<? foreach($item2 as $item3) { 
			$v = $item[$item3];

			if(!is_array($v)) $v = array('html' => $v);
			$align = 'left';
			if($v['align']) $align = $v['align'];
			$width = $titles[$item3][0];
			if($width >= 999) $width = '100%';
			$style = $v['style'];
			?>
			<td align="<?=$align?>" height="30" width="<?=$width?>"<? if($style) echo ' style="'.$style.'"';?>><?
			
			echo $v['html'];
			?></td>

		<? } ?>
	</tr>
	</table>
	<? if($key2 != count($title_widths) - 1) { ?><div style="margin-bottom:5px; border-top: 1px dashed #dddddd"></div> <? } ?>
<? } 

		echo '</div>';
		} } ?>
<? if($config['showpage']) { 
	
	?>
<div class="pagediv" style="<?=$config_hide_frame_left?"margin:0px auto;":""?>margin-top:0px;height:auto;overflow-x:hidden;width:100%;">
<?=gpageHTML($pageinfo['page'], $pageinfo['pagecount'], $pageinfo['count'], "javascript:getListData(%s);", 20)?>
</div>

<? } ?>